import service from "@/utils/request";
//文件服务列表
export const fileQuery = (data) => {
  return service({
    url: "/file/getList",
    method: "post",
    data,
  });
};
//上传
export const fileUpload = (data) => {
  return service({
    url: "/file/upload",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
};
//下载
export const fileDownload = (params) => {
  return service({
    url: "/file/download",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/octet-stream",
    },
    responseType: "blob",
  });
};
//根据路径下载文件
export const downloadByPath = (params) => {
  return service({
    url: "/file/downloadByPath",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/octet-stream",
    },
    responseType: "blob",
  });
};
//删除
export const fileDel = (data) => {
  return service({
    url: "/file/delete",
    method: "delete",
    data,
  });
};
